<!DOCTYPE html>
<html lang="en" manifest="/header.appcache">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>支付宝支付</title>
</head>
<script src="../../js/edition.js"></script>
<link rel="stylesheet" href="../../css/base.css">
<script>
        document.write("<l"+"ink rel='stylesheet' href='../../css/cart.css?version="+edition+"'>")
</script>
<link rel="stylesheet" href="../../css/popover.css">
<script>
        document.write("<l"+"ink rel='stylesheet' href='../../css/index.css?version="+edition+"'>")
</script>
<script src="../../js/jquery.js"></script>
<script src="../../js/template.js"></script>
<script> 
        document.write("<s"+"cript type='text/javascript' src='../../js/url.js?version="+edition+"'></scr"+"ipt>"); 
</script>
<script src="../../js/popover.js"></script>
<script src="../../js/header.js"></script>
<script src="../../js/index_foot.js"></script>

<script src="../../js/jquery.cookie.js"></script>
<script> 
        document.write("<s"+"cript type='text/javascript' src='../../js/login.js?version="+edition+"'></scr"+"ipt>"); 
</script>
<script src="../../js/cookie.js"></script>
<!-- <script> 
        document.write("<s"+"cript type='text/javascript' src='../../js/pay_commit.js?version="+edition+"'></scr"+"ipt>"); 
</script> -->
<!-- <script src="../../js/pay_commit.js"></script> -->
<script src="../../js/qrcode.js"></script>
<body style="background:#fff;">
<header class="mod_head">
    <script>
        $(function(){
            var src=$('.mod_logo img').attr('src')
            $('.mod_logo img').attr('src','../'+src)
        })   
    </script> 
</header>    
<div class="g-bd"> 
  <div class="mod_body_tit" id="">
      <div class="box_a">支付单号：520562843018998214</div>
      <div class="right_pay_num">应付金额：<span>0.02</span>元</div>
  </div>
  
  <div class="mod_weixin_pay">
      <div class="code_wrap">
          <div class="code_img" id="codeImg">
                <div id="qrcode">
                        
                </div>
          </div>
          请使用支付宝扫描二维码
      </div>
      <!--<img src="../../img/weixin_pay.jpg" alt="" class="prompt">-->
  </div>   
    <input type="hidden" id="getval"/>
    <!--<button id="send">点击更换验证码</button>-->

  <script type="text/javascript">
      $(function(){
        var pay_num=''
        var payNumber=''
        var token=''
        var productType=''
        var url=window.location.search;
            var id = url.substring(url.lastIndexOf('&')+1, url.length);
            var s=id.split(',')
            for (var i in s){
                payNumber=s[2]
                token=s[1]
                productType=s[4]
            // console.info($.cookie('m'))
            window.onload =function(){
                var qrcode = new QRCode(document.getElementById("qrcode"), {
                    width : 170,//设置宽高
                    height : 170
                });
                qrcode.makeCode(s[0]);
                // document.getElementById("send").onclick =function(){
                //     qrcode.makeCode(document.getElementById("getval").value);
                // }
            }
                $('.box_a').text('支付单号：'+s[2])
                $('.right_pay_num span').text(parseFloat(s[3]).toFixed(2))
                // console.log(s[3])
                pay_num=s[3]
            }
        window.setInterval(showalert, 1000); 
        function showalert(){ 
            $.ajax({
                url:new_url+'shop/payment/getOrderPayResult',
                type:'post',
                dataType:'json',
                data:{payNumber:payNumber,token:token,productType:productType},
                success:function(e){
                    // console.log(e)
                    if(e.code=='0'){
                        window.location.href='/src/cart/complete.html?pay_num='+pay_num
                    }
                }
            })
        } 
      })
  </script>
</div>
<footer class="mod_foot"></footer> 
<script>
    $(function(){
        var w_h=$(window).height();
        $('.g-bd').css('min-height',(w_h-287)+'px');
        // 底部小图标路径修改
        $('.foot_list>img').each(function(){
            var src = $(this).attr('src');
            $(this).attr('src','../../'+src);
        });
        // 底部链接修改
        $('.footer_ul a').each(function(){
            var newHref = $(this).attr('href');
            if(newHref!='javascript:;'){
                $(this).attr('href','..'+newHref);
            }
        });
    });
</script>
<script> 
    document.write("<s"+"cript type='text/javascript' src='../../js/nav_hover.js?version="+edition+"'></scr"+"ipt>"); 
</script>
</body>
</html>